package dfbz.com.service.impl;

import dfbz.com.controller.conference.ConferenceServlet;
import dfbz.com.dao.ConJoinDao;
import dfbz.com.dao.ConferenceDao;
import dfbz.com.model.Conference;
import dfbz.com.service.ConferenceService;

import java.sql.SQLException;
import java.util.Date;
import java.util.List;
import java.util.Map;

public class ConferenceServiceImpl implements ConferenceService {

    private  ConferenceDao conferenceDao=new ConferenceDao();
    private ConJoinDao conJoinDao=new ConJoinDao();


    public List<Map<String, Object>> show(Integer deptid, int page, String search){
     return conferenceDao.show(deptid,page,search);
    }

    @Override
    public long findTotalConferenceCount(Integer deptId) {
        return conferenceDao.findTotalConferenceCount(deptId);
    }

    @Override
    public void add(String deptName, Integer deptId, String title, String content, Date pdate, String startTime
            , Integer status,long total) {
        conferenceDao.add(deptName,deptId,title,content,pdate,startTime,status,total);
    }

    @Override
    public String getNameById(Integer deptId) {
        return conferenceDao.getNameById(deptId);
    }

    @Override
    public void updateStatus() {
        conferenceDao.updateStatus();
    }

    @Override
    public Map<String, Object> getMeetById(Integer id) {
        return conferenceDao.getMeetById(id);
    }

    @Override
    public void notice(List<Map<String, Object>> workers,Integer deptId, long total,Integer count) {
        try {
            conJoinDao.notice(workers,deptId,total,count);
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }

    @Override
    public Long getJoinMeetDetail(Integer id) {
        return conJoinDao.getJoinMeetDetail(id);
    }


    /**
     * 更新与会人员状态
     * @param id
     */
    @Override
    public void updateJoinStatus(Integer id,Integer mid) {
        conJoinDao.updateJoinStatus(id,mid);
    }

    @Override
    public Integer findLastConferenceCount() {
        return conJoinDao.findLastConferenceCount();
    }

    @Override
    public Integer getConJoinCount() {
        return conJoinDao.getConJoinCount();
    }


}
